//
//  BaseTabBarViewController.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/7.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class BaseTabBarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        tabBar.translucent     = false
        
        tabBar.barTintColor    = UIColor.Hex6(0x3c3c3c)

    }
}

//MARK:- 屏幕旋转相关
extension BaseTabBarViewController{
    
    override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
        if (selectedViewController != nil) {
            return selectedViewController!.supportedInterfaceOrientations()
        }else{
            return .Portrait
        }
    }
    
    override func shouldAutorotate() -> Bool {
        if (selectedViewController != nil) {
            return selectedViewController!.shouldAutorotate()
        }else{
            return false
        }
    }
    
    override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
        if (selectedViewController != nil) {
            return selectedViewController!.preferredInterfaceOrientationForPresentation()
        }else{
            return .Portrait
        }
    }
    
}
